package bishe;

import java.awt.*;
import java.io.IOException;
import javax.swing.*;

public class Admin {
	public static void Administrator() throws IOException {
		// TODO 自动生成的方法存根
		JFrame MainMenu = new JFrame("管理员菜单");
		JTabbedPane jpt = new JTabbedPane(JTabbedPane.LEFT);
		// 窗口设置
		MainMenu.setLayout(new BorderLayout());
		MainMenu.setSize(800, 700);
		MainMenu.setLocation(500, 200);
		MainMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JPanel mainpanel = new JPanel();
		JLabel image = new JLabel();
		ImageIcon icon = new ImageIcon("super.jpg");
		Image img = icon.getImage();
		img = img.getScaledInstance(430, 500, Image.SCALE_DEFAULT);
		icon.setImage(img);
		image.setIcon(icon);
		JPanel ton1 = new JPanel();
		JPanel ton2 = new JPanel();
		JPanel ton5 = new JPanel();
		// 欢迎界面初始化
		ton1.add(image);
		// 预览界面初始化
		ton2 = new admintable().read();
		// 查询商品界面初始化
		ton5 = new admintable().found();
		
		jpt.add(ton1, "欢迎");
		jpt.add(ton2, "预览");
		jpt.add(ton5, "查询");
		MainMenu.add(jpt);
		MainMenu.add(mainpanel, BorderLayout.PAGE_END);
		MainMenu.setVisible(true);
		// 注册监听器
	}
}
